import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
     {
        path: '/login',
        name: 'login',
        component: () => import('../views/User/Login.vue'),
      },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/menu',
      name: 'menu',
      component: () => import('../views/MenuRole1.vue'),
      children:[
      {
        path: '/getuser',
        name: 'getuser',
        component: () => import('../views/User/GetUser.vue'),
      },
      {
        path: '/role',
        name: 'getrole',
        component: () => import('../views/Role/GetRole.vue'),
      },
       {
        path: '/getmenu',
        name: 'getmenu',
        component: () => import('../views/Menu/GetMenu.vue'),
      },
       {
        path: '/getrolemenu',
        name: 'getrolemenu',
        component: () => import('../views/Role/RoleMenu.vue'),
      },
      {
        path: '/getapproval',
        name: 'getapproval',
        component: () => import('../views/Approval/GetApproval.vue'),
      },
       {
        path: '/getbiao',
        name: 'getbiao',
        component: () => import('../views/BaoBiao/GetBaoBiao.vue'),
      },
      ]
    },
      {
        path: '/menurole',
        name: 'menurole',
        component: () => import('../views/MenuRole.vue'),
      },

      {
        path: '/',
        name: 'menu1',
        component: () => import('../views/CompanyManage.vue'),
        children:[
          {
            path: '/traceability',
            name: 'traceability',
            component: () => import('../views/TraceabilityView.vue'),
          },
          {
            path: '/traceDetail',
            name: 'traceDetail',
            component: () => import('../views/TraceDetail.vue'),
          },
          { 
            path: '/slaughter-detail',
            name: 'slaughter-detail',
            component: () => import('../views/SlaughterDetail.vue'),
          },
           {
            path: '/deep',
            name: 'deep',
            component: () => import('../views/DeepProcessDetail.vue'),
          },
        ]
      },
      
   
  ],
  
})

export default router
